package com.carambatv.android.ui.sliding;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.ListFragment;

import com.carambatv.android.R;
import com.carambatv.android.ui.feed.FeedFragment;
import com.slidingmenu.lib.SlidingMenu;
import com.slidingmenu.lib.app.SlidingFragmentActivity;

public class BaseActivity extends SlidingFragmentActivity {

	protected ListFragment mFrag;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setBehindContentView(R.layout.feed_fragment);

		SlidingMenu sm = getSlidingMenu();
		sm.setShadowWidthRes(R.dimen.padding_small);
		sm.setShadowDrawable(R.drawable.ic_launcher);
		sm.setBehindOffsetRes(R.dimen.actionbar_home_width);

		if (savedInstanceState == null) {
			Fragment mFragment = new FeedFragment();
			FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
			transaction.replace(R.id.feed_fragment, mFragment);
			transaction.commit();
		}

	}

}
